'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');


module.exports = yeoman.extend({

    // 0. 重写构造函数
    constructor: function () {
        // 加上apply这句就能接收命令参数了
        yeoman.apply(this, arguments);
        
        // 命令参数
        this.argument('name', {
            type: String,
            required: true,
        });

        this.argument('root', {
            type: String,
            required: true,
        })

        console.log(chalk.bgRed(this.options.name));
        console.log(chalk.bgRed(this.options.root));
    },

    // 1. 接收参数
    prompting: function () {
        
    },

    // 2. 渲染模版
    writing: function () {
        
    },

    // 3. 安装依赖
    install: function () {
        // this.npmInstall();
    }
});